package com.empire.module.member.dal.mysql.event;

import java.util.*;

import com.empire.framework.common.pojo.PageResult;
import com.empire.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.empire.framework.mybatis.core.mapper.BaseMapperX;
import com.empire.module.member.dal.dataobject.event.EventDO;
import org.apache.ibatis.annotations.Mapper;
import com.empire.module.member.controller.admin.event.vo.*;

/**
 * 境外人员事件管理 Mapper
 *
 * @author 主席大人
 */
@Mapper
public interface EventMapper extends BaseMapperX<EventDO> {

    default PageResult<EventDO> selectPage(EventPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<EventDO>()
                .eqIfPresent(EventDO::getContent, reqVO.getContent())
                .eqIfPresent(EventDO::getPersonId, reqVO.getPersonId())
                .betweenIfPresent(EventDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(EventDO::getId));
    }

}